/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.dao.recent;

import java.io.Serializable;
import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dragon
 */
@Entity
@Table(name = "recent_clearing_accountfare")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RecentClearingAccountFare.findAll", query = "SELECT r FROM RecentClearingAccountFare r"),
    @NamedQuery(name = "RecentClearingAccountFare.findById", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.id = :id"),
    @NamedQuery(name = "RecentClearingAccountFare.findByClearingDate", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.clearingDate = :clearingDate"),
    @NamedQuery(name = "RecentClearingAccountFare.findByAccountCode", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.accountCode = :accountCode"),
    @NamedQuery(name = "RecentClearingAccountFare.findByTempID", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.tempID = :tempID"),
    @NamedQuery(name = "RecentClearingAccountFare.findByMarketCode", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.marketCode = :marketCode"),
    @NamedQuery(name = "RecentClearingAccountFare.findByClassCode", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.classCode = :classCode"),
    @NamedQuery(name = "RecentClearingAccountFare.findByUnderlyingCode", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.underlyingCode = :underlyingCode"),
    @NamedQuery(name = "RecentClearingAccountFare.findByObj", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.obj = :obj"),
    @NamedQuery(name = "RecentClearingAccountFare.findByBs", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.bs = :bs"),
    @NamedQuery(name = "RecentClearingAccountFare.findByOpenClose", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.openClose = :openClose"),
    @NamedQuery(name = "RecentClearingAccountFare.findByCommission0", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.commission0 = :commission0"),
    @NamedQuery(name = "RecentClearingAccountFare.findByCommission1", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.commission1 = :commission1"),
    @NamedQuery(name = "RecentClearingAccountFare.findByMinCommission0", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.minCommission0 = :minCommission0"),
    @NamedQuery(name = "RecentClearingAccountFare.findByMinCommission1", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.minCommission1 = :minCommission1"),
    @NamedQuery(name = "RecentClearingAccountFare.findByDeliverFare0", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.deliverFare0 = :deliverFare0"),
    @NamedQuery(name = "RecentClearingAccountFare.findByDeliverFare1", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.deliverFare1 = :deliverFare1"),
    @NamedQuery(name = "RecentClearingAccountFare.findByTax0", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.tax0 = :tax0"),
    @NamedQuery(name = "RecentClearingAccountFare.findByTax1", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.tax1 = :tax1"),
    @NamedQuery(name = "RecentClearingAccountFare.findByEtax1", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.etax1 = :etax1"),
    @NamedQuery(name = "RecentClearingAccountFare.findByEtax0", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.etax0 = :etax0"),
    @NamedQuery(name = "RecentClearingAccountFare.findByCost0", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.cost0 = :cost0"),
    @NamedQuery(name = "RecentClearingAccountFare.findByCost1", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.cost1 = :cost1"),
    @NamedQuery(name = "RecentClearingAccountFare.findByOwnUserID", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.ownUserID = :ownUserID"),
    @NamedQuery(name = "RecentClearingAccountFare.findByAlterUserID", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.alterUserID = :alterUserID"),
    @NamedQuery(name = "RecentClearingAccountFare.findByCreateTime", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.createTime = :createTime"),
    @NamedQuery(name = "RecentClearingAccountFare.findByTimeStamp", query = "SELECT r FROM RecentClearingAccountFare r WHERE r.timeStamp = :timeStamp")})
public class RecentClearingAccountFare implements Serializable {
	public static byte[] EnCode(RecentClearingAccountFare msg) throws IOException {
		Codec<RecentClearingAccountFare> Lcode = ProtobufProxy.create(RecentClearingAccountFare.class);
		return Lcode.encode(msg);
	}
	public static RecentClearingAccountFare DeCode(byte[] data) throws IOException {
	Codec<RecentClearingAccountFare> Lcode = ProtobufProxy.create(RecentClearingAccountFare.class);
		return Lcode.decode(data);
	}

    private static final long serialVersionUID = 1L;
    @Id
    //@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    @Protobuf
	private Long id;
    @Basic(optional = false)
    @Column(name = "ClearingDate")
    @Temporal(TemporalType.DATE)
    private Date clearingDate;
	@Protobuf
	private long clearingDateL;
    @Basic(optional = false)
    @Column(name = "AccountCode")
    @Protobuf
	private String accountCode;
    @Column(name = "TempID")
    @Protobuf
	private Integer tempID;
    @Column(name = "MarketCode")
    @Protobuf
	private String marketCode;
    @Column(name = "ClassCode")
    @Protobuf
	private String classCode;
    @Column(name = "UnderlyingCode")
    @Protobuf
	private String underlyingCode;
    @Column(name = "Obj")
    @Protobuf
	private String obj;
    @Column(name = "BS")
    @Protobuf
	private String bs;
    @Column(name = "OpenClose")
    @Protobuf
	private String openClose;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "Commission0")
    @Protobuf
	private Float commission0;
    @Column(name = "Commission1")
    @Protobuf
	private Float commission1;
    @Column(name = "MinCommission0")
    @Protobuf
	private Float minCommission0;
    @Column(name = "MinCommission1")
    @Protobuf
	private Float minCommission1;
    @Column(name = "DeliverFare0")
    @Protobuf
	private Float deliverFare0;
    @Column(name = "DeliverFare1")
    @Protobuf
	private Float deliverFare1;
    @Column(name = "Tax0")
    @Protobuf
	private Float tax0;
    @Column(name = "Tax1")
    @Protobuf
	private Float tax1;
    @Column(name = "Etax1")
    @Protobuf
	private Float etax1;
    @Column(name = "Etax0")
    @Protobuf
	private Float etax0;
    @Column(name = "Cost0")
    @Protobuf
	private Float cost0;
    @Column(name = "Cost1")
    @Protobuf
	private Float cost1;
    @Column(name = "OwnUserID")
    @Protobuf
	private String ownUserID;
    @Column(name = "AlterUserID")
    @Protobuf
	private String alterUserID;
    @Column(name = "CreateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
	//@Protobuf
//tprivate long createTimeL;
    @Column(name = "TimeStamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeStamp;
	//@Protobuf
	//private long timeStampL;

    public RecentClearingAccountFare() {
    }

    public RecentClearingAccountFare(Long id) {
        this.id = id;
    }

    public RecentClearingAccountFare(Long id, Date clearingDate, String accountCode) {
        this.id = id;
        this.clearingDate = clearingDate;
		this.clearingDateL = CodeTool.DateToLong(clearingDate);
        this.accountCode = accountCode;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getClearingDate() {
        return clearingDate;
    }

    public void setClearingDate(Date clearingDate) {
        this.clearingDate = clearingDate;
        this.setClearingDateL(CodeTool.DateToLong(clearingDate));
    }

    public String getAccountCode() {
        return accountCode;
    }

    public void setAccountCode(String accountCode) {
        this.accountCode = accountCode;
    }

    public Integer getTempID() {
        return tempID;
    }

    public void setTempID(Integer tempID) {
        this.tempID = tempID;
    }

    public String getMarketCode() {
        return marketCode;
    }

    public void setMarketCode(String marketCode) {
        this.marketCode = marketCode;
    }

    public String getClassCode() {
        return classCode;
    }

    public void setClassCode(String classCode) {
        this.classCode = classCode;
    }

    public String getUnderlyingCode() {
        return underlyingCode;
    }

    public void setUnderlyingCode(String underlyingCode) {
        this.underlyingCode = underlyingCode;
    }

    public String getObj() {
        return obj;
    }

    public void setObj(String obj) {
        this.obj = obj;
    }

    public String getBs() {
        return bs;
    }

    public void setBs(String bs) {
        this.bs = bs;
    }

    public String getOpenClose() {
        return openClose;
    }

    public void setOpenClose(String openClose) {
        this.openClose = openClose;
    }

    public Float getCommission0() {
        return commission0;
    }

    public void setCommission0(Float commission0) {
        this.commission0 = commission0;
    }

    public Float getCommission1() {
        return commission1;
    }

    public void setCommission1(Float commission1) {
        this.commission1 = commission1;
    }

    public Float getMinCommission0() {
        return minCommission0;
    }

    public void setMinCommission0(Float minCommission0) {
        this.minCommission0 = minCommission0;
    }

    public Float getMinCommission1() {
        return minCommission1;
    }

    public void setMinCommission1(Float minCommission1) {
        this.minCommission1 = minCommission1;
    }

    public Float getDeliverFare0() {
        return deliverFare0;
    }

    public void setDeliverFare0(Float deliverFare0) {
        this.deliverFare0 = deliverFare0;
    }

    public Float getDeliverFare1() {
        return deliverFare1;
    }

    public void setDeliverFare1(Float deliverFare1) {
        this.deliverFare1 = deliverFare1;
    }

    public Float getTax0() {
        return tax0;
    }

    public void setTax0(Float tax0) {
        this.tax0 = tax0;
    }

    public Float getTax1() {
        return tax1;
    }

    public void setTax1(Float tax1) {
        this.tax1 = tax1;
    }

    public Float getEtax1() {
        return etax1;
    }

    public void setEtax1(Float etax1) {
        this.etax1 = etax1;
    }

    public Float getEtax0() {
        return etax0;
    }

    public void setEtax0(Float etax0) {
        this.etax0 = etax0;
    }

    public Float getCost0() {
        return cost0;
    }

    public void setCost0(Float cost0) {
        this.cost0 = cost0;
    }

    public Float getCost1() {
        return cost1;
    }

    public void setCost1(Float cost1) {
        this.cost1 = cost1;
    }

    public String getOwnUserID() {
        return ownUserID;
    }

    public void setOwnUserID(String ownUserID) {
        this.ownUserID = ownUserID;
    }

    public String getAlterUserID() {
        return alterUserID;
    }

    public void setAlterUserID(String alterUserID) {
        this.alterUserID = alterUserID;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
		//this.createTimeL = CodeTool.DateToLong(createTime);
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
		//this.timeStampL = CodeTool.DateToLong(timeStamp);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RecentClearingAccountFare)) {
            return false;
        }
        RecentClearingAccountFare other = (RecentClearingAccountFare) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jili.ubert.dao.recent.RecentClearingAccountFare[ id=" + id + " ]";
    }

    public long getClearingDateL() {
        return clearingDateL;
    }

    public void setClearingDateL(long clearingDateL) {
        this.clearingDateL = clearingDateL;
		this.clearingDate = CodeTool.LongToDate(clearingDateL);
    }
    
}
